﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using TaoPortal.Common;

namespace TaoPortal
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            //routes.Add("ImagesRoute",
            //     new Route("", new UrlRouteHandler()));
            //采购部分路由
            //routes.MapRoute(
            //    "skin1", // 路由名称
            //    "skin1/{controller}/{action}/{id}", // 带有参数的 URL
            //    new { controller = "AddCaiGou", action = "Index", id = UrlParameter.Optional } // 参数默认值
            //);
            routes.MapRoute(
                name: "File",
                url: "File/{id}/{size}",
                defaults: new { controller = "File", action = "Index", id = UrlParameter.Optional, size = UrlParameter.Optional },
                namespaces: new string[] { "TaoPortal.Controllers" }
            );

            routes.MapRoute(
                name: "DeownloadFile",
                url: "DeownloadFile/{id}",
                defaults: new { controller = "DeownloadFile", action = "Index", id = UrlParameter.Optional },
                namespaces: new string[] { "TaoPortal.Controllers" }
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new string[] { "TaoPortal.Controllers" }
            );

        }
    }
}